home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 6
/
CU Amiga Magazine's Super CD-ROM 06 (1996)(EMAP Images)(GB)(Track 1 of 4)[!][issue 1997-01].iso
/
cucd
/
readers
/
utils
/
gui4cli
/
g4c
/
gm
/
fpcalc.gc
< prev
next >
Wrap
Text File
|
1996-10-28
|
3KB
|
196 lines
G4C
; A simple calculator GUI with floating point calculation. No
; fancy bits, just functional.
; GUIS:Fonts/gc.font (c) G.Maddox
; G.Maddox 26 Sep 1996
WinBig -1 -1 197 124 "Calculator"
WinSmall 200 0 235 -1
WinType 11110000
WinOut NIL:
xOnLoad
IfExists PORT AREXX
Setvar cal_disp "0"
Setvar .cal_form ""
Setvar cal_swtch "1"
GuiOpen FPCalc.gc
Update FPCalc.gc 21 $cal_disp
Else
CLI 'SYS:System/RexxMast >NIL:'
Setvar cal_disp "0"
Setvar .cal_form ""
Setvar cal_swtch "1"
GuiOpen FPCalc.gc
Update FPCalc.gc 21 $cal_disp
Endif
xOnClose
Delvar cal_#?
Delete env:.cal_#?
GuiQuit FPCalc.gc
BOX 0 0 0 0 OUT BUTTON
BOX 4 2 189 120 OUT ICONDROP
BOX 10 5 177 114 OUT BUTTON
xButton 30 33 30 14 "T"
Gadkey 1
GadFont gc.font 14 000
Setvar cal_knum "1"
Appvar .cal_form 1
Gosub FPCalc.gc enter
xButton 66 33 30 14 "t"
Gadkey 2
GadFont gc.font 14 000
Setvar cal_knum "2"
Appvar .cal_form 2
Gosub FPCalc.gc enter
xButton 102 33 30 14 "U"
Gadkey 3
GadFont gc.font 14 000
Setvar cal_knum "3"
Appvar .cal_form 3
Gosub FPCalc.gc enter
xButton 138 33 30 14 "}"
Gadkey *
GadFont gc.font 14 000
Appvar .cal_form *
Setvar cal_disp ""
Update FPCalc.gc 21 $cal_disp
xButton 30 97 30 14 "#"
Gadkey c
GadFont gc.font 14 000
Setvar .cal_form ""
Setvar cal_disp ""
Update FPCalc.gc 21 0 ;$cal_disp
xButton 30 49 30 14 "u"
Gadkey 4
GadFont gc.font 14 000
Setvar cal_knum "4"
Appvar .cal_form 4
Gosub FPCalc.gc enter
xButton 66 49 30 14 "V"
Gadkey 5
GadFont gc.font 14 000
Setvar cal_knum "5"
Appvar .cal_form 5
Gosub FPCalc.gc enter
xButton 102 49 30 14 "v"
Gadkey 6
GadFont gc.font 14 000
Setvar cal_knum "6"
Appvar .cal_form 6
Gosub FPCalc.gc enter
xButton 138 49 30 14 "]"
Gadkey +
GadFont gc.font 14 000
Appvar .cal_form +
Setvar cal_disp ""
Update FPCalc.gc 21 $cal_disp
xButton 66 97 30 14 "c"
GadKey #8
GadFont gc.font 14 000
Cutvar .cal_form CUT CHAR -1 end
Cutvar cal_disp CUT CHAR -1 end
Update FPCalc.gc 21 $cal_disp
xButton 30 65 30 14 "W"
Gadkey 7
GadFont gc.font 14 000
Setvar cal_knum "7"
Appvar .cal_form 7
Gosub FPCalc.gc enter
xButton 66 65 30 14 "w"
Gadkey 8
GadFont gc.font 14 000
Setvar cal_knum "8"
Appvar .cal_form 8
Gosub FPCalc.gc enter
xButton 102 65 30 14 "("
Gadkey 9
GadFont gc.font 14 000
Setvar cal_knum "9"
Appvar .cal_form 9
Gosub FPCalc.gc enter
xButton 138 65 30 14 "["
Gadkey -
GadFont gc.font 14 000
Appvar .cal_form -
Setvar cal_disp ""
Update FPCalc.gc 21 $cal_disp
xButton 30 81 30 14 ">"
Gadkey .
GadFont gc.font 14 000
Setvar cal_knum "."
Appvar .cal_form .
Gosub FPCalc.gc enter
xButton 66 81 30 14 ")"
Gadkey 0
GadFont gc.font 14 000
Setvar cal_knum "0"
Appvar .cal_form 0
Gosub FPCalc.gc enter
xButton 102 81 30 14 "="
Gadkey #13
GadFont gc.font 14 000
If $cal_swtch = 0
Setvar cal_swtch "1"
Else
Setvar cal_swtch "0"
Endif
Gosub FPCalc.gc calc
xButton 138 81 30 14 "{"
Gadkey /
GadFont gc.font 14 000
Appvar .cal_form /
Setvar cal_disp ""
Update FPCalc.gc 21 $cal_disp
Text 18 10 160 16 $cal_disp 15 BOX
GadID 21
GadFont gc.font 14 000
xRoutine calc
If $.cal_form > ""
CLI 'sys:rexxc/rx \"say $.cal_form\" >env:.cal_res\n'
Update FPCalc.gc 21 $.cal_res
Setvar .cal_calc ""
Endif
Return
xRoutine enter
If $cal_swtch = 0
Appvar cal_disp '$cal_knum'
Else
Setvar cal_disp '$cal_knum'
Endif
Setvar cal_swtch "0"
Update FPCalc.gc 21 $cal_disp
Return